import java.util.HashMap;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description: owo
 * User: DELL
 * Date: 2024-05-24
 * Time: 9:02
 */
public class Main5 {
    static String[] strs;

    /**
     * 本题的分类讨论太过复杂，考场上不可能写出来，因此暴力获取部分分
     *
     * @param args
     */
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        if (n <= 20) {
            strs = new String[n];
            for (int i = 0; i < n; i++) {
                strs[i] = scanner.next();
                int ans = dfs(i + 1, 0, new int[i + 1], new HashMap<>());
                System.out.println(ans);
            }
        }
    }

    private static int dfs(int n, int k, int[] arr, HashMap<Integer, Integer> map) {
        if (k == n) {
            return judge(arr);
        }
        int ans = 0;
        for (int i = 0; i < n; i++) {
            if (!map.containsKey(i)) {
                arr[k] = i;
                map.put(i, 1);
                ans = Math.max(ans, dfs(n, k + 1, arr, map));
                map.remove(i);
            }
        }
        return ans;
    }

    private static int judge(int[] arr) {
        int res = 0;
        StringBuilder builder = new StringBuilder();
        for (int i = 0; i < arr.length; i++) {
            builder.append(strs[arr[i]]);
        }
        for (int i = 0; i < builder.length() - 2; i++) {
            if (builder.charAt(i) == 'o' && builder.charAt(i + 1) == 'w' && builder.charAt(i + 2) == 'o') {
                res++;
            }
        }
        return res;
    }
}
